package com.TTBook.utils.pages;

public class PageUtils {
	
	/**
	 * 设置返回总记录数默认值
	 */
	public static final int DEFAULT_MAXRESULTS = 20;
	
	
	/**
	 * 初始化查询从第几条记录数开始
	 * @param skipResults
	 * @return
	 */
	public static int initSkipResults(int skipResults){
		return skipResults ;
	}
	
	/**
	 * 初始化当前是第几页
	 * @param skipResults
	 * @param maxResults
	 * @return
	 */
	public static int initPageIndex(int skipResults,int maxResults){
		if(maxResults < 1) maxResults = 1;
		return skipResults/maxResults + 1;
	}
}
